//2009/08/15 17:24:36
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class Highscore
{
public:
    int getRank(vector <int> scores, int newscore, int places)
    {
		int eq = 0;
		int gt = 0;
		//sort(scores.rbegin(), scores.rend());
		for(int i=0; i<scores.size(); i++)
		{
			if(newscore < scores[i]) gt ++;
			if(newscore == scores[i]) eq ++;
		}
		if(eq + gt + 1 > places) return -1;
		return gt + 1;
    }
};
